
#ifndef EXPITEMFORMAT_H
#define EXPITEMFORMAT_H

#include <BMap>
#include <BRect>
#include <BRange>
#include <BFont>
#include <BExp>
#include <BTextFormat>

using namespace BWE;

class ExpItemFormat : public BTextFormat
{
public:
	ExpItemFormat(BExp* exp);
	~ExpItemFormat();

	virtual void styled(const BStyle* style) override;
	virtual void changed(const BString& text) override;

	virtual const BFont* font(int pos) const;
	virtual const BColor* color(int pos) const;

	void clear();

protected:
	BColor syntaxColor(Syntax syntax);

public:
	BExpHolder				_exp;
	BMap<int, BColor>		_colorMap;
	BMap<int, BFontHolder>	_fontMap;
};

#endif
